<template lang="html">
  <section class="section1">
    <h1 class="section1-title">热卖商品 </h1>
    <ul class="section1-list">
      <li v-for="(item, index) in list" :key="index">
        <div>
          <img v-lazy="item.image" @click="moveTo(item)" alt="">
          <span>{{ item.storeName }}</span>
          <b> ￥{{ item.price.toFixed(2) }} + 茶籽 {{ item.teaSeedNum }}</b>
        </div>
      </li>
    </ul>
  </section>
</template>

<script>

import {Lazyload} from 'mint-ui';

export default {
  props: {
    list: {
      type: Array,
      default: function () {
        return []
      }
    }
  },
  methods: {
    moveTo(item) {
      this.$router.push({path: '/detail', query: {id: item.id}})
    }
  }
}

</script>

<style lang="less" scoped>
@import "../../assets/fz.less";
@import "../../assets/index/style.css";

.section1 {
  margin-top: 10px;

  .section1-title {
    .bt();
    background-color: #ffffff;
    color: black;
    font-weight: bold;
    text-align: center;
    padding: 4vw 0;
    .fz(font-size, 40);
    color: #333;
    position: relative;

    i {
      position: absolute;
      right: 6vw;
      top: 50%;
      .fz(font-size, 36);
      .fz(margin-top, -16);

      &::before {
        color: rgb(159, 159, 159);
      }
    }
  }

  .section1-list {
    background: transparent;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;

    li {
      width: 50%;
      margin-top: 10px;
      border-radius: 6px;
      overflow: hidden;
      padding: 0 4px;
      box-sizing: border-box;
      background: transparent;

      div {
        background-color: white;
        padding-bottom: 10px;
        border-radius: 6px;
        overflow: hidden;
      }

      a,
      img {
        width: 100%;
        height: 160px;
        display: block;
        max-width: 100%;
        max-height: 100%;
      }

      span {
        display: block;
        padding-left: 4px;
        font-size: 14px;
        margin-top: 10px;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      b {
        display: block;
        color: #048AB9;
        margin: 8px 0 4px;
        font-size: 16px;
        font-weight: normal;
        padding-left: 4px;
      }

      i {
        font-size: 12px;
        padding-left: 4px;
        color: #8c8c8c;
      }
    }
  }

  .section1-banner {
    display: block;
    width: 100vw;

    img {
      width: 100%;
      height: 24vw;
    }
  }
}
</style>
